<template>
  <div>
    vuex
    <button @click="handleClick">count: {{ age }}</button>
  </div>
</template>

<script setup lang="ts">
import { computed, onMounted } from 'vue'
import store, { useStore } from '@/store/index'

const age = computed(() => useStore().getters.userInfo.age)
onMounted(() => {
  console.log('store: ', age)
})

const handleClick = () => {
  store.commit('user/SET_USER_AGE')
}
</script>
<style></style>
